<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3"><a id="head" ></a>角色新增/修改</h1>
</div>
<div class="wrapper-md no-padder" ng-controller="roleEditController">
    <div class="panel panel-default">
		<div class="panel-body">
			<form class="form-horizontal form-validation col-sm-11" method="get" name="form">
				<label class="col-sm-2 control-label">角色名</label>
				<div class="col-sm-4">
					<input type="text" class="form-control  m-b-xs" ng-readonly="type == 'update'"
						ng-model="entity.name" required> 
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label" >角色</label>
				<div class="col-sm-4">
					<input type="text" name="role" class="form-control m-b-xs" ui-validate-async="{unique : 'unique($value)' }" ng-model="entity.role" required >
					<div class="bg-danger" ng-show="form.role.$invalid">
                        <div ng-show="form.role.$error.unique">角色代码已经存在，请重新输入。</div>
                    </div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label" >描述</label>
				<div class="col-sm-4">
					<textarea type="text" class="form-control  m-b-xs" placeholder="描述" ng-model="entity.remarks"></textarea>
				</div>

				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="col-sm-5 col-sm-offset-2">
					<div class="m-b-md">
						<uib-alert ng-repeat="alert in Alert.alerts" type="{{alert.type}}" close="Alert.closeAlert($index)">
						{{alert.msg}} </uib-alert>
					</div>
					<!-- / alert -->
					<button type="button" class="btn btn-default" ng-click="canle()">返回</button>
					<button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || saveBtnDisable"
						ng-click="save(); saveBtnDisable = true;">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
			</form>
		</div>
	</div>
</div>